<!--24-DOM-getElementsByTagName.html-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>getElementsByTagName</title>
    <script>
        function clickAll() {
            var elemt = document.getElementsByTagName("input");
            for (var i = 0; i < elemt.length; i++) {
                elemt[i].checked = true;
            }
        }
        
    </script>
</head>
<body>
    选择你喜欢的语言：
    <input type="checkbox"/>Java
    <input type="checkbox"/>C++
    <input type="checkbox"/>Python
    <br>
    <button onclick="clickAll()">全选</button>
</body>
</html>